/* 
 * File:   debugprintdetail.h
 * Author: meng
 *
 * Created on May 5, 2011, 2:27 PM
 */

#ifndef DEBUGPRINTDETAIL_H
#define	DEBUGPRINTDETAIL_H

#include "outformat.h"
#include "stdffield.h"
#include <vector>
#include "chararray.h"
#include "gdrstdffield.h"


namespace opsrc {
    namespace stdf {

    class DebugPrintDetail : public OutFormat {
    public:
        DebugPrintDetail();
        virtual ~DebugPrintDetail();

        void out(RecBase* rec);
        void out(string& msg);
        void out(const char* msg);
        void out(int value);
        void out(float value);
        void out(long value);

        void open();
        void close();


    protected:
        void printHeaderInfo(RecBase* rec);
        void printFieldInfo(const char* name, StdfField<unsigned int>& f, long stdfRecStartBytePosition);
        void printFieldInfo(const char* name, StdfField<int>& f, long stdfRecStartBytePosition);
        void printFieldInfo(const char* name, StdfField<string>& f, long stdfRecStartBytePosition);
        void printFieldInfo(const char* name, StdfField<unsigned long>& f, long stdfRecStartBytePosition);
        void printFieldInfo(const char* name, StdfField<long>& f, long stdfRecStartBytePosition);
        void printFieldInfo(const char* name, StdfField<vector<bool> >& f, long stdfRecStartBytePosition);
        void printFieldInfo(const char* name, StdfField<vector<int> >& f, long stdfRecStartBytePosition);
        void printFieldInfo(const char* name, StdfField<vector<unsigned int> >& f, long stdfRecStartBytePosition);
        void printFieldInfo(const char* name, StdfField<float>& f, long stdfRecStartBytePosition);
        void printFieldInfo(const char* name, StdfField<vector<float> >& f, long stdfRecStartBytePosition);
        void printFieldInfo(const char* name, StdfField<CharArray>& f, long stdfRecStartBytePosition);
        void printFieldInfo(const char* name, GdrStdfField& f, long stdfRecStartBytePosition );
        void printFieldInfo(const char* name, StdfField<vector<string> >& f, long stdfRecStartBytePosition);

        void printFieldInfo(const char* name, StdfField<long>& f, long stdfRecStartBytePosition, string (*pfunct)(long)  );
        void printFieldInfo(const char* name, StdfField<unsigned int>& f, long stdfRecStartBytePosition, string (*pfunct)(unsigned int)  );

    private:
      //  DebugPrintDetail(const DebugPrintDetail& orig);
        iostream* s;
       

    };
  }
}
#endif	/* DEBUGPRINTDETAIL_H */

